package com.drm.netschool.mapper;

import com.drm.netschool.entity.DrmCourseComment;
import com.drm.netschool.entity.DrmCourseCommentExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface DrmCourseCommentMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_comment
     *
     * @mbggenerated Wed Aug 26 15:42:15 CST 2015
     */
    int countByExample(DrmCourseCommentExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_comment
     *
     * @mbggenerated Wed Aug 26 15:42:15 CST 2015
     */
    int deleteByExample(DrmCourseCommentExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_comment
     *
     * @mbggenerated Wed Aug 26 15:42:15 CST 2015
     */
    @Delete({
        "delete from drm_course_comment",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_comment
     *
     * @mbggenerated Wed Aug 26 15:42:15 CST 2015
     */
    @Insert({
        "insert into drm_course_comment (id, course_id, ",
        "commont_cdt, commont_txt, ",
        "commont_uid, commont_pid, ",
        "commont_seq, commont_del, ",
        "commont_deldt, comment_star)",
        "values (#{id,jdbcType=BIGINT}, #{courseId,jdbcType=BIGINT}, ",
        "#{commontCdt,jdbcType=TIMESTAMP}, #{commontTxt,jdbcType=VARCHAR}, ",
        "#{commontUid,jdbcType=BIGINT}, #{commontPid,jdbcType=BIGINT}, ",
        "#{commontSeq,jdbcType=INTEGER}, #{commontDel,jdbcType=INTEGER}, ",
        "#{commontDeldt,jdbcType=TIMESTAMP}, #{commentStar,jdbcType=INTEGER})"
    })
    int insert(DrmCourseComment record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_comment
     *
     * @mbggenerated Wed Aug 26 15:42:15 CST 2015
     */
    int insertSelective(DrmCourseComment record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_comment
     *
     * @mbggenerated Wed Aug 26 15:42:15 CST 2015
     */
    List<DrmCourseComment> selectByExample(DrmCourseCommentExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_comment
     *
     * @mbggenerated Wed Aug 26 15:42:15 CST 2015
     */
    @Select({
        "select",
        "id, course_id, commont_cdt, commont_txt, commont_uid, commont_pid, commont_seq, ",
        "commont_del, commont_deldt, comment_star",
        "from drm_course_comment",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @ResultMap("BaseResultMap")
    DrmCourseComment selectByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_comment
     *
     * @mbggenerated Wed Aug 26 15:42:15 CST 2015
     */
    int updateByExampleSelective(@Param("record") DrmCourseComment record, @Param("example") DrmCourseCommentExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_comment
     *
     * @mbggenerated Wed Aug 26 15:42:15 CST 2015
     */
    int updateByExample(@Param("record") DrmCourseComment record, @Param("example") DrmCourseCommentExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_comment
     *
     * @mbggenerated Wed Aug 26 15:42:15 CST 2015
     */
    int updateByPrimaryKeySelective(DrmCourseComment record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_comment
     *
     * @mbggenerated Wed Aug 26 15:42:15 CST 2015
     */
    @Update({
        "update drm_course_comment",
        "set course_id = #{courseId,jdbcType=BIGINT},",
          "commont_cdt = #{commontCdt,jdbcType=TIMESTAMP},",
          "commont_txt = #{commontTxt,jdbcType=VARCHAR},",
          "commont_uid = #{commontUid,jdbcType=BIGINT},",
          "commont_pid = #{commontPid,jdbcType=BIGINT},",
          "commont_seq = #{commontSeq,jdbcType=INTEGER},",
          "commont_del = #{commontDel,jdbcType=INTEGER},",
          "commont_deldt = #{commontDeldt,jdbcType=TIMESTAMP},",
          "comment_star = #{commentStar,jdbcType=INTEGER}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(DrmCourseComment record);
}